	<blockquote class="layui-elem-quote"><{$action}></blockquote>

	<fieldset class="layui-elem-field">
  		<legend>按条件搜索</legend>
  		<div class="layui-field-box">
			<form class="layui-form layui-form-pane1" method="post" action="<{$current_url}>">
				<div class="layui-form-item">
					<div class="layui-inline">
						<select name="type" id="type">
							<option value="0" <{if isset($conditions) AND $conditions.type == 0}>selected<{/if}>>所有题型</option>
							<option value="1" <{if isset($conditions) AND $conditions.type == 1}>selected<{/if}>>单选题</option>
							<option value="2" <{if isset($conditions) AND $conditions.type == 2}>selected<{/if}>>多选题</option>
							<option value="3" <{if isset($conditions) AND $conditions.type == 3}>selected<{/if}>>判断题</option>
							<option value="4" <{if isset($conditions) AND $conditions.type == 4}>selected<{/if}>>计算分析题</option>
						</select>
					</div>
			    	<div class="layui-inline">
			    		<input type="text" name="subject_text" id="subject_text" placeholder="题目内容" value="<{if isset($conditions) AND $conditions.subject_text != 0}><{$conditions.subject_text}><{/if}>" class="layui-input">
			    	</div>
			    	<div class="layui-inline">
			    		<button type="submit" class="layui-btn">搜索</button>
			    	</div>
		    	</div>
			</form>
  		</div>
	</fieldset>
		<table class="layui-table" lay-even lay-skin="row">
		  	<thead>
			  	<tr>
				  	<th>序号</th>
				  	<th>题干</th>
				  	<th>题目来源</th>
				  	<th>题型</th>
			  	</tr>
		  	</thead>   
		  	<tbody>
		  	<{foreach from=$topic_list item=item}>
			  	<tr>
			  		<td class="center">
						<input type="checkbox" topic_type="<{$item['type']}>" class="ids" name="ids[]" value="<{$item['id']}>" title="<{$item['id']}>">
			  		</td>
			  		<td class="center"><{$item['subject_text']}></td>
			  		<td class="center"><{if $item['source_type'] == 1}>系统<{else}>自有<{/if}></td>
			  		<td class="center"><{if $item['type'] == 1}>单选题<{elseif $item['type'] == 2}>多选题<{elseif $item['type'] == 3}>判断题<{/if}></td>
			  	</tr>
		  	<{/foreach}>
		  	<{if $topic_list|count eq 0}>
		  		<tr>
			  		<td class="center" style=" height:120px; text-align:center;line-height:120px;" colspan="8">
						赞无数据！
					</td>
			  	</tr>
		  	<{/if}>
	  		</tbody>
	  	</table>
  	<div class="layui-box layui-laypage layui-laypage-default">
		<{$pagination}>
	</div>
	<!-- parent.document.getElementById("check_item").value -->
	<script type="text/javascript" src="/static/public/jquery-1.11.1.min.js"></script>
	<script>
		$(function(){
			if($(window.parent.document).find(".selected_topic").length > 0)
			$(window.parent.document).find(".selected_topic").each(function (index, obj){
				$("input[title='"+$(obj).val()+"']").attr("checked", true)
			});

			$(".ids").click(function(){
				var _this = $(this);
				$(window.parent.document).find(".type_" + _this.attr("topic_type")).each(function (index,obj){
					if(_this.is(':checked')){
						if($(obj).hasClass('selected') == false){
							$(obj).addClass("selected");
							$(obj).css("background-color", "red");
							var input = "<input type='hidden' class='selected_topic' name='topic["+_this.val()+"]' value='"+_this.val()+"'>";
							$(window.parent.document).find("#type_" + _this.attr("topic_type")).append(input);
							return false;
						}
					}else{
						if($(obj).hasClass('selected')){
							$(obj).removeClass("selected");
							$(obj).css("background-color", "#FFF");
							$(window.parent.document).find("input[name='topic["+_this.val()+"]']").remove();
							return false;
						}
					}
				});
				// $(window.parent.document).find("#topic_list").html($(this).val());
			})
		})
	</script>